home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------*/
- /* The main purpose for the routines in the module is to provide a */
- /* degree of compatibility between Turbo C and Microsoft C. Turbo C */
- /* provides a number of direct interfaces to MS-DOS/BIOS services that */
- /* Mirosoft C does NOT provide. */
-
- #include <stdio.h>
-
- #if __TURBOC__
- #include <dir.h>
- #else
- #include <dos.h>
- #include <direct.h>
- #endif
-
- int
- GetCurrentDirectory (int Disk, char *CurDir) {
-
- #ifdef __TURBOC__
- return(getcurdir(Disk + 1, CurDir));
-
- #else
-
- unsigned CurDrive, NumberOfDrives;
-
- _dos_getdrive(&CurDrive);
- _dos_setdrive(Disk + 1, &NumberOfDrives);
- getcwd(CurDir - 3, 66);
- _dos_setdrive(CurDrive, &NumberOfDrives);
- return(0);
- #endif
-
- }
-
- void
- GetCurrentDisk (int *CurDisk) {
-
- #ifdef __TURBOC__
- *CurDisk = getdisk();
-
- #else
- int Temp;
- _dos_getdrive(&Temp);
- *CurDisk = Temp - 1;
-
- #endif
-
- }